/*
 * application.c
 *
 *  Created on: 2025年4月23日
 *      Author: lzf
 */
#include "application.h"
#include "led.h"
#include "nvs_flash.h"
#include "regex.h"
#include "myiic.h"
#include "xl9555.h"
#include "spi.h"
#include "lcd.h"
#include "touch.h"
#include "at24c02.h"
#include "timg.h"

 void bsp_init(void)
 {
	 esp_err_t ret = nvs_flash_init();
	 if (ret == ESP_ERR_NVS_NO_FREE_PAGES ||
		 ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
		 ESP_ERROR_CHECK(nvs_flash_erase());
		 ret = nvs_flash_init();
	 }
	 ESP_ERROR_CHECK(ret);
	 led_init();
	 myiic_init();
	 xl9555_init();
	 at24c02_init(); /* 初始化24CXX */
	 spi2_init();	 /* 初始化SPI */
	 /* 初始化显示设备RGBLCD */
	 lcd_init();				 /* RGB屏初始化 */
	 timg_init(1000, 1000000); /* 定时器0初始化 */
 }


